CREATE PROCEDURE RRHH_BUSCAR_TURNO_L
@IDHORARIO INTEGER,
@ESTADOTRAN INTEGER OUTPUT
AS

--SET TRANSACTION ISOLATION LEVEL SERIALIZABLE

BEGIN TRANSACTION
BEGIN TRY
	SELECT * FROM HORARIOXDIA
	WHERE IDHORARIO = @IDHORARIO
	ORDER BY IDDIA
	
	SET @ESTADOTRAN = 1
	
	COMMIT TRANSACTION
END TRY
BEGIN CATCH
	SET @ESTADOTRAN = 0
	
	ROLLBACK TRANSACTION
END CATCH